import java.util.Random;
import java.util.Scanner;

public class Game {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);       //输入工具
        Random random = new Random();                   //生成随机数工具
        int Rnum = random.nextInt(101);         //生成0~100的随机数
        //让用户输入并判断
        while(true) {
            System.out.println("请输入一个数字：");
            int num = scanner.nextInt();
            if(num==Rnum){
                System.out.println("猜对了");
                break;
            }
            else if(num>Rnum){
                System.out.println("猜大了");
            }
            else{
                System.out.println("猜小了");
            }
        }
    }
}
